const { resolve, isMp } = require("./shared")
const cssMacro = require("weapp-tailwindcss/css-macro")
const { addDynamicIconSelectors } = require("@iconify/tailwind")
// const { iconsPlugin, getIconCollections } = require("@egoist/tailwindcss-icons")
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./index.html", "./**/*.vue"].map(resolve),
  theme: {},
  plugins: [
    addDynamicIconSelectors(),
    // iconsPlugin({
    //   // Select the icon collections you want to use
    //   collections: getIconCollections(["mdi", "ei"]),
    // }),
    // https://weapp-tw.icebreaker.top/docs/quick-start/uni-app-css-macro
    cssMacro({
      variantsMap: {
        wx: "MP-WEIXIN",
        "-wx": {
          value: "MP-WEIXIN",
          negative: true
        }
      }
    })
  ],
  corePlugins: {
    preflight: !isMp
  }
}
